package com.css.test1;

import android.app.Application;
import android.content.Context;
import android.os.Handler;
import android.os.Process;
import android.view.WindowManager;

import org.xutils.x;

/**
 * Created by css on 2017/11/2.
 */

public class MyApplication extends Application {
    private static Context context;
    private static Handler handler;
    private static int mainThreadId;
    private static WindowManager wm;

    @Override
    public void onCreate() {
        super.onCreate();
        CrashHandler.getInstance().init(this);
        context = getApplicationContext();
        handler = new Handler();
        mainThreadId = Process.myUid();
        wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
        x.Ext.init(this);
        x.Ext.setDebug(true); // 是否输出debug日志
    }


    public static WindowManager getWm() {
        return wm;
    }

    public static Context getContext() {
        return context;
    }

    public static Handler getHandler() {
        return handler;
    }

    public static int getMainThreadId() {
        return mainThreadId;
    }
}
